package com.example.demo;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.context.annotation.PropertySources;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.PostConstruct;
import javax.swing.*;

/**
 * @Author :蕉绿
 * @Date : 2023/2/14 16:41
 * @Version : V1.0
 * @Description :
 */

@RestController

public class TestController {

    @Value("${mytest}")
    private String my;

    @Value("${string.value}")
    private String my2;

    @RequestMapping("/hello")
    public String sayHi() {
        return "你好!  张三";
    }

    @Autowired
    private Student student;

    @RequestMapping("/student")
    public Student postConstruct() {
        return student;
    }



    @RequestMapping("/config")
    public String getConfig() {
        return my + " " +my2;
    }


}
